<%@page contentType="text/html" pageEncoding="UTF-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quản Lý Khuyến Mãi</title>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<jsp:include page="admin-header.jsp" />
<div class="admin-table">
            <h2>Thông Tin Khuyến Mãi</h2>		
	<table class="table-bordered">
	<thead>
	<tr>
            <th>Mã khuyến mãi</th>
            <th>Tên khuyến mãi</th>
            <th>Nội dung</th>
	</tr>
	</thead>
            <tbody style="border: 1px solid #333;">
                <c:forEach items="${listkm}" var="listkm" >
                    <tr style="border: 1px solid #333;">
                        <td>${listkm.makm}</td>
                        <td>${listkm.tenkm}</td>
                        <td>${listkm.noidungkm}</td> 
                    </tr>
                </c:forEach>
            </tbody>
     	</table>
     	</div>
     	
		<form class="tknc" id ="themdm" accept-charset="UTF-8" method = "POST" action="quanlykhuyenmai?option=addnew">
		<div class="login-header">
			<span>Thêm khuyến mãi</span>
		</div>
		<div class="login-content">
		<label>Tên khuyến mãi :</label>  
		<input type = "text" name = "tenkm" required>
		<label>Nội dung khuyến mãi :</label>  
		<input type = "text" name = "noidungkm" required>
		<input type = "submit" value = "Save" >
		</div>
		</form>
<div class="tknc" id="qc">
	<div class="login-header">
		<span>Sửa khuyến mãi</span>
	</div>
	<div class="login-content">
	<form method = "POST" action="quanlykhuyenmai?option=edit">
	Tên khuyến mãi : <input type = "text" name = "tenkm" value = ${listkm.get(0).getTenkm() } required>
	Nội dung khuyến mãi : <textarea name = "noidungkm" required>${listkm.get(0).getNoidungkm() }</textarea>
	<input type = hidden name = "makm" value = ${listkm.get(0).getMakm() }>
	<input type = "submit" value = "Lưu" >
	</form>
	</div>
</div>
</body>
</html>